﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OgilvyOne.Ext.Weibo.Common
{
    /// <summary>
    /// Defines constants used in AMicroBlogAPI.
    /// </summary>
    public static class Constants
    {
        public class Pattern
        {
            public const string RetrieveRequestTokenPattern = "^oauth_token=(.+?)&oauth_token_secret=(.+?)$";
            public const string RetrieveAccessTokenPattern = "^oauth_token=(.+?)&oauth_token_secret=(.+?)(&user_id=(.+?)){0,1}(&screen_name=(.+?)){0,1}$";
            public const string RetrieveAuthorizationCodePattern = "<oauth_verifier>(.+?)</oauth_verifier>";
        }

        public class Post
        {
            public const string PostMultiPartContentType = "multipart/form-data; boundary={0}";
            public const string PostContentType = "application/x-www-form-urlencoded";
        }

        public class Xml
        {
            public const string XmlHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
        }

        public const string Source = "source";

        public class OAuth
        {
            public const string OAuthHeaderPrefix = "OAuth2 ";
            public const string OAuthConsumerKey = "oauth_consumer_key";
            public const string OAuthSignatureMethod = "oauth_signature_method";
            public const string OAuthTimestamp = "oauth_timestamp";
            public const string OAuthNonce = "oauth_nonce";
            public const string OAuthVersion = "oauth_version";
            public const string OAuthSignature = "oauth_signature";
            public const string OAuthToken = "access_token";
            public const string OAuthVerifier = "oauth_verifier";

            public static string OAuthCallback = "oauth_callback";
        }

        public class Json
        {
            public static string JsonHeader = "{";
        }
    }
}
